#pragma once;

class Pass
{
public:
    // The InvalidPass object is used to represent
    // an invalid pass. This is useful if the user
    // requests a Pass from a technique that doesn't exist.
    // Users should check if a pass is valid before trying to use it.
    static Pass InvalidPass;

    const std::string& GetPassName() const;

    // Begins the pass.
    // Returns false if the pass is not valid.
    bool BeginPass();
    void EndPass();

    // Returns true if this is a valid pass.
    bool IsValid() const;
protected:

private:
    friend class Technique;
    // A pass cannot be created directly, it can only be 
    // retrieved from a technique.
    Pass( CGcontext context, CGpass pass );
    virtual ~Pass();

    CGcontext   m_cgContext;
    CGpass      m_cgPass;

    std::string m_PassName;
    bool        m_bIsValid;
};